package com.lvcoding.action;

import com.lvcoding.bean.User;
import com.lvcoding.service.UserService;
import com.opensymphony.xwork2.Action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @author wuyanshen
 * @discription 描述
 * @date 2020-07-08 5:46 下午
 */
@Controller
@Scope("prototype")
public class UserAction implements Action {

    private User user;

    @Autowired
    private UserService userService;


    @Override
    public String execute() throws Exception {
        userService.save(user);
        return Action.SUCCESS;
    }


    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }


}
